const express=require("express")
const router=express.Router();
const pool=require("../pool");
//删除汽车收藏
router.get("/",(req,res)=>{
  var id=req.query.id;
  //2:sql select
  var sql=`DELETE FROM yhc_cart WHERE id = ?`;
  pool.query(sql,[id],(err,result)=>{
    if(err) throw err;
    if(result.affectedRows > 0){
      res.send({code:1,msg:'删除成功'});
    }else{
      res.send({code:0,msg:'删除失败'});
    }
  })
})
module.exports=router;